package com.example.mqttmodule.config;

import lombok.extern.log4j.Log4j2;
import org.dromara.mica.mqtt.spring.server.event.MqttClientOfflineEvent;
import org.dromara.mica.mqtt.spring.server.event.MqttClientOnlineEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

@Service
@Log4j2
public class MqttConnectStatusListener {

    @EventListener
    public void online(MqttClientOnlineEvent event) {
        log.info("MqttClientOnlineEvent:{}", event);
    }

    @EventListener
    public void offline(MqttClientOfflineEvent event) {
        log.info("MqttClientOfflineEvent:{}", event);
    }

}